<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SC Transportes - Cadastro Usuário</title>
#{set 'moreStyles'}
        #{stylesheet 'main.css' /}
#{/set}
#{get 'moreStyles' /}
</head>

<body>

	<div id="wrapper">

        <div id="logomarca">
        </div><!-- #logomarca-->
        
        <div id="titleBar">
            Cadastro > <span>Novo Funcionario</span>
        <a class="sair" href="@{Application.index()}">Sair</a> </div><!-- #titleBar -->
        
        <div id="content">
        	<form action="@{FuncionarioApplication.cadastrarFuncionario()}" method="post">
	        	<div style="color: red; font-weight: bold; text-align: center;">
	        		${msgErro != null ? msgErro : ''}
	        	</div>
	            <table width="600" cellpadding="0" cellspacing="5">
	                <tr>
	                	<td valign="top">Cargo:</td>
	                	<td>
	                    <select name="idCargo">
								<option value="0" selected="selected"> -- SELECIONE -- </option>
								#{list items:cargos, as:'cargo'}
									#{if funcionario.cargo == cargo}
									<option value="${cargo.id}" selected="selected">${cargo.nome}</option>
									#{/if}
									#{else}
									<option value="${cargo.id}">${cargo.nome}</option>
									#{/else}
								#{/list}
						</select>
						</td>
	                </tr>
	                <tr>
	                	<td valign="top">Usuario:</td>
	                	<td>
	                    <select name="idUsuario">
								<option value="0" selected="selected"> -- SELECIONE -- </option>
								#{list items:users, as:'usuario'}
									#{if funcionario.usuario == usuario}
									<option value="${usuario.id}" selected="selected">${usuario.nome}</option>
									#{/if}
									#{else}
									<option value="${usuario.id}">${usuario.nome}</option>
									#{/else}
								#{/list}
						</select>
						</td>
	                </tr>
	                <tr>
	                    <td></td>
	                    <td>
	                    	<input type="hidden" name="idFuncionario" value="${funcionario.id}" />
	                        <input type="submit" class="button" value="${funcionario.id > 0 ? 'Editar' : 'Cadastrar'}" />
	                        <a href="@{Application.cancelar()}"><input type="button" class="button" value="Cancelar" /></a>
	                    </td>
	                </tr>
	            </table>
            </form>
        </div><!-- #content -->
      
        <div id="footer">
        	2012 - SC Transporte - Todos os direitos reservados
        </div><!-- #footer -->
        
	</div><!-- #wrapper -->

</body>
</html>